<nz-modal [(nzVisible)]="isVisible" [nzWidth]="modalWidth" (nzOnCancel)="onBack()" [nzStyle]="{'top': '50px'}">
  <div *nzModalTitle>{{ title }}</div>
  <ng-container *nzModalContent>
    <form [formGroup]="parkingChargeForm" (keydown.enter)="$event.preventDefault()">
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="parkingAreaNumber" nzRequired>车位号</nz-form-label>
            <nz-form-control [nzErrorTip]="'请选择车位号'">
              <nz-input-group nzSearch [nzAddOnAfter]="parkingAreaNumberSuffixIconButton">
                <input nz-input formControlName="parkingAreaNumber" placeholder="请选择车位号" readonly />
              </nz-input-group>
              <ng-template #parkingAreaNumberSuffixIconButton>
                <button nz-button nzType="primary" nzSearch (click)="findParkingArea()"><nz-icon nzType="search" /></button>
              </ng-template>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="residentRoomNumber" nzRequired>单元房号</nz-form-label>
            <nz-form-control [nzErrorTip]="'请选择单元房号'">
              <nz-input-group nzSearch [nzAddOnAfter]="residentRoomNumberSuffixIconButton">
                <input nz-input formControlName="residentRoomNumber" placeholder="请选择单元房号" readonly />
              </nz-input-group>
              <ng-template #residentRoomNumberSuffixIconButton>
                <button nz-button nzType="primary" nzSearch (click)="findRoom()"><nz-icon nzType="search" /></button>
              </ng-template>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="licensePlate">车牌</nz-form-label>
            <nz-form-control>
              <input nz-input formControlName="licensePlate" placeholder="请输入车牌" maxlength="32"/>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="billingStartDate">使用开始时间</nz-form-label>
            <nz-form-control >
              <nz-date-picker formControlName="billingStartDate" nzFormat="yyyy-MM-dd"></nz-date-picker>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="billingEndDate">使用结束时间</nz-form-label>
            <nz-form-control >
              <nz-date-picker formControlName="billingEndDate" nzFormat="yyyy-MM-dd"></nz-date-picker>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="amount">金额</nz-form-label>
            <nz-form-control>
            <nz-input-number formControlName="amount" [nzMin]="1" [nzMax]="1" />
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="remark">备注</nz-form-label>
            <nz-form-control>
              <input nz-input formControlName="remark" placeholder="请输入备注" maxlength="255"/>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
    </form>
  </ng-container>
  <div *nzModalFooter>
    <div class="form-button-container">
      <button nz-button nzType="primary" (click)="onSave()" [nzLoading]="saveLoading">保存</button>
      <button nz-button nzType="default" (click)="onReset()" [nzLoading]="saveLoading">重置</button>
      <button nz-button nzType="default" (click)="onBack()">关闭</button>
    </div>
  </div>
</nz-modal>
<parking-area-selector (parkingAreaSelectedEvent)="handleParkingAreaSelectedEvent($event)"></parking-area-selector>
<room-selector (roomSelectedEvent)="handleRoomSelectedEvent($event)"></room-selector>
